package com.itheima.output;

import java.io.*;

public class OutputDemo06 {
    public static void main(String[] args) throws IOException {
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("day12_file&字节流\\a.txt"));
        bos.write("hello".getBytes());
        bos.write("java".getBytes());
        bos.write("world".getBytes());
        bos.close();
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("day12_file&字节流\\a.txt"));

        byte[] bys = new byte[1024];
        int len;

        while ((len = bis.read(bys)) != -1) {
            System.out.print(new String(bys, 0, len));
        }

        bis.close();
    }
}
